package com.edu.d4_innerclass_anomous;

/**
 * 匿名内部类,匿名内部类的书写格式
 */
public class Test {
    public static void main(String[] args) {
        /*Animal animal=new tiger();
        animal.run();*/
        Animal animal = new Animal(){
            @Override
            public void run() {
                System.out.println("老虎跑得很快");
            }
        };
        animal.run();
    }

}
/*class tiger extends Animal{

    @Override
    public void run() {
        System.out.println("老虎跑得很快");
    }
}*/
abstract class Animal{
    public abstract void run();
}
